package scenic;

import java.awt.Rectangle;

import scenic.geom.Affine2;

/**
 * This brush paints a solid color.
 */
public class SolidColor extends Brush {
	Color color;
	
	/**
	 * Constructs a new solid color brush.
	 * 
	 * @param color the color.
	 */
	public SolidColor(Color color) {
		this.color = color;
	}

	/**
	 * Gets the color.
	 */
	public Color getColor() {
		return color;
	}
	
	/**
	 * Sets the color.
	 */
	public void setColor(Color color) {
		this.color = color;
		changed();
	}

	void draw(DrawContext context, Affine2 transform, Rectangle visibleArea) {
		context.renderer.color(context.context, color);
		context.renderer.solidColor(context.context);
	}
}
